package cn.hahah.module.blog.dal.mysql.articletag;

import java.util.*;

import cn.hahah.framework.common.pojo.PageResult;
import cn.hahah.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.hahah.framework.mybatis.core.mapper.BaseMapperX;
import cn.hahah.module.blog.dal.dataobject.articletag.ArticleTagDO;
import org.apache.ibatis.annotations.Mapper;
import cn.hahah.module.blog.controller.admin.articletag.vo.*;

/**
 * 文章标签 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ArticleTagMapper extends BaseMapperX<ArticleTagDO> {

    default PageResult<ArticleTagDO> selectPage(ArticleTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ArticleTagDO>()
                .eqIfPresent(ArticleTagDO::getTagId, reqVO.getTagId())
                .eqIfPresent(ArticleTagDO::getArticleId, reqVO.getArticleId())
                .betweenIfPresent(ArticleTagDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ArticleTagDO::getId));
    }

}